package com.zhuangjie.mvc.injector;

import com.zhuangjie.mvc.injector.porter.InjectPorter;

import java.util.function.Function;

/**
 * 喇叭（声明注入）
 *
 * @author zhuangjie
 * @date 2024/06/14
 */
public class Horn<T,P extends InjectPorter> {
    private final P injectPorter;
    public Horn(P injectPorter) {
        this.injectPorter = injectPorter;
    }

    public<R> void horn(Function<P, R> porterConsumer) {
        porterConsumer.apply(injectPorter);
    }
}
